<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button onclick="send()">发送请求</button>
    <script>
      function send() {
        let r = fetch("http://localhost:8888/test1");
        console.log(r);

        r.then((response) => {
          console.log(response);
          return response.json();
        })
          .then((data) => {
            console.log(data);
          })
          .catch((reason) => {
            console.log(reason);
          });
      }
    </script>
  </body>
</html>
